import smtplib
from email.mime.text import MIMEText
from email.header import Header


def email(address, content):
    message = MIMEText(content)  # 邮件内容
    message['From'] = "2410005858@qq.com"  # 邮件发送者名字
    message['To'] = Header('recv')  # 邮件接收者名字
    message['Subject'] = Header('代码敲不队')  # 邮件主题

    mail = smtplib.SMTP()
    mail.connect("smtp.qq.com")  # 连接 qq 邮箱
    mail.login("2410005858@qq.com", "jyjrorjxsxgddhih")  # 账号和授权码
    mail.sendmail("2410005858@qq.com", [address], message.as_string())

#email("2410005858@qq.com", "null")